#include<stdio.h>
#include<string.h>
#include <unistd.h>
#define NUM 100
int main()
{
  char bar[NUM+1];
  char str[]="|\\/-";
  memset(bar,'\0',sizeof(bar));
  int i=0;
  while(i<=100)
  {
    printf("[%-100s][%-3d%%][%c]\r",bar,i,str[i%4]);
    fflush(stdout);
    usleep(50000);
    bar[i]='=';
    bar[i+1]='>';
    i++;
  }
  printf("\n");
  return 0;
}
